const fs = require('fs');
module.exports={
  //随机生成guid
    createGuid: function () {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
      let r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
      return v.toString(16);
    });
  },//生产时间戳
    getNowTime:function () {
      let nowdate = (new Date().getTime())/1000;
        return nowdate.toFixed(0);
    },
    writeErr(err){
        fs.appendFile('./databasesErr.txt',err,'utf8',(err)=>{
        })
    },
    verify(reqData) {
        for (let key in reqData){
           if(!reqData[key]){
             return false;
           }
        }
        return true;
    }
}